package com.bawei.park2212.patrols

import android.graphics.Color
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.lib_common.view.entity.DateBean
import com.example.module_service.R

class DateAdapter :BaseQuickAdapter<DateBean,BaseViewHolder>(R.layout.item_date){
    override fun convert(helper: BaseViewHolder, item: DateBean) {
        val tv_week = helper.getView<TextView>(R.id.item_week)
        val tv_day = helper.getView<TextView>(R.id.item_day)
        tv_week.setText(item.week)
        tv_day.setText(item.dat.toString())
        if (item.isToday){
            helper.getView<ConstraintLayout>(R.id.item_con).setBackgroundResource(com.example.lib_common.R.drawable.shape_solid_blue)
            tv_week.setTextColor(Color.WHITE)
            tv_day.setTextColor(Color.WHITE)
        }

    }
}